package liyh.adapter.media.impl;

import liyh.adapter.media.MediaPlayer;
import liyh.adapter.media.adapter.MediaAdapter;

public class AudioPlayer implements MediaPlayer {
    private MediaAdapter mediaAdapter;

    @Override
    public void play(String type, String name) {
        if (type.equalsIgnoreCase("mp3")) {
            System.out.println("Playing mp3 file. Name: " + name);
        } else if (type.equalsIgnoreCase("vlc") || type.equalsIgnoreCase("mp4")) {
            mediaAdapter = new MediaAdapter(type);
            mediaAdapter.play(type, name);
        } else {
            System.out.println("Invalid media. " + type + " format not supported");

        }
    }
}
